package com.ican.study2.web.controller.user;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import com.ican.javadoc.biz.domain.user.User;
import com.ican.javadoc.biz.service.user.UserService;

/**
 *  这是用户控制中心
 * @author Administrator
 * @version 1.0.0
 * @see  http://test.com
 */
@Controller
@RequestMapping("/user/user")
public class UserController {
    
    private UserService userService;
    
    /**
     * 登陆
     * @param user
     * @return tt
     */
    @RequestMapping("login")
    public String login(User user, ModelMap modelMap){
        userService.addUser(user);
        modelMap.put("user", user);
        return "/demo/login";
    }

    @Resource
    public void setUserService(UserService userService) {
        this.userService = userService;
    }
}
